﻿@model BrnMall.Web.Models.CartModel
@{
    Layout = null;
}
@if (Model != null && Model.StoreCartList.Count > 0)
{
<div class="shoppingT">最新加入的商品</div>
<div class="cartSnap">

    @foreach (StoreCartInfo storeCartInfo in Model.StoreCartList)
    {
        foreach (CartItemInfo cartItemInfo in storeCartInfo.CartItemList)
        {
            if (cartItemInfo.Type == 0)
            {
                CartProductInfo cartProductInfo = (CartProductInfo)cartItemInfo.Item;
                <div class="shoppingI">
                    <img src="@{@WorkContext.ImageCDN}/upload/store/@cartProductInfo.OrderProductInfo.StoreId/product/show/thumb60_60/@cartProductInfo.OrderProductInfo.ShowImg" width="64" height="64" />
                    <em><a href="@Url.Action("product", "catalog", new RouteValueDictionary { { "pid", cartProductInfo.OrderProductInfo.Pid } })">@cartProductInfo.OrderProductInfo.Name</a></em> <b>¥@cartProductInfo.OrderProductInfo.DiscountPrice<span>×@cartProductInfo.OrderProductInfo.RealCount</span><a href="javascript:void(0)" onclick="delCartProduct(@cartProductInfo.OrderProductInfo.Pid,1)">删除</a></b>
                    <div class="clear"></div>
                    @foreach (OrderProductInfo gift in cartProductInfo.GiftList)
                    {
                    <a href="@Url.Action("product", "catalog", new RouteValueDictionary { { "pid", gift.Pid } })" class="ZP1">[赠品]@gift.Name</a>
                    }
                </div>
            }
            else if (cartItemInfo.Type == 1)
            {
                CartSuitInfo cartSuitInfo = (CartSuitInfo)cartItemInfo.Item;
                <h3><s class="bgMZ">套装</s><p>小计：￥@cartSuitInfo.SuitAmount &nbsp;&nbsp; <a href="javascript:void(0)" onclick="delCartSuit(@cartSuitInfo.PmId,1)">删除</a></p></h3>
                foreach (CartProductInfo cartProductInfo in cartSuitInfo.CartProductList)
                {
                <div class="shoppingI">
                    <img src="@{@WorkContext.ImageCDN}/upload/store/@cartProductInfo.OrderProductInfo.StoreId/product/show/thumb60_60/@cartProductInfo.OrderProductInfo.ShowImg" width="64" height="64" />
                    <em><a href="@Url.Action("product", "catalog", new RouteValueDictionary { { "pid", cartProductInfo.OrderProductInfo.Pid } })">@cartProductInfo.OrderProductInfo.Name</a></em> <b>¥@cartProductInfo.OrderProductInfo.DiscountPrice<span>×@cartProductInfo.OrderProductInfo.RealCount</span></b>
                    <div class="clear"></div>
                    @foreach (OrderProductInfo gift in cartProductInfo.GiftList)
                    {
                    <a href="@Url.Action("product", "catalog", new RouteValueDictionary { { "pid", gift.Pid } })" class="ZP1">[赠品]@gift.Name</a>
                    }
                </div>
                }
            }
            else if (cartItemInfo.Type == 2)
            {
                CartFullSendInfo cartFullSendInfo = (CartFullSendInfo)cartItemInfo.Item;
                if (cartFullSendInfo.FullSendMinorOrderProductInfo != null)
                {
                    <h3><s class="bgMZ">满赠</s> 已购满 @cartFullSendInfo.FullSendPromotionInfo.LimitMoney 元,您已经换购了商品</h3>
                    <div class="fullSendSnap"><a href="@Url.Action("product", "catalog", new RouteValueDictionary { { "pid", cartFullSendInfo.FullSendMinorOrderProductInfo.Pid } })" class="left ZP">[赠品] @cartFullSendInfo.FullSendMinorOrderProductInfo.Name</a><div class="right"><a href="javascript:void(0)" onclick="delCartFullSend(@cartFullSendInfo.FullSendPromotionInfo.PmId,1)">删除</a></div><div class="clear"></div></div>
                }
                else if (cartFullSendInfo.FullSendPromotionInfo != null)
                {
                    <h3><s class="bgMZ">满赠</s> 购满 @cartFullSendInfo.FullSendPromotionInfo.LimitMoney 元,再加 @cartFullSendInfo.FullSendPromotionInfo.AddMoney 元换购商品</h3>
                }

                foreach (CartProductInfo cartProductInfo in cartFullSendInfo.FullSendMainCartProductList)
                {
                <div class="shoppingI">
                    <img src="@{@WorkContext.ImageCDN}/upload/store/@cartProductInfo.OrderProductInfo.StoreId/product/show/thumb60_60/@cartProductInfo.OrderProductInfo.ShowImg" width="64" height="64" />
                    <em><a href="@Url.Action("product", "catalog", new RouteValueDictionary { { "pid", cartProductInfo.OrderProductInfo.Pid } })">@cartProductInfo.OrderProductInfo.Name</a></em> <b>¥@cartProductInfo.OrderProductInfo.DiscountPrice<span>×@cartProductInfo.OrderProductInfo.RealCount</span><a href="javascript:void(0)" onclick="delCartProduct(@cartProductInfo.OrderProductInfo.Pid,1)">删除</a></b>
                    <div class="clear"></div>
                    @foreach (OrderProductInfo gift in cartProductInfo.GiftList)
                    {
                    <a href="@Url.Action("product", "catalog", new RouteValueDictionary { { "pid", gift.Pid } })" class="ZP1">[赠品]@gift.Name</a>
                    }
                </div>
                }
            }
            else if (cartItemInfo.Type == 3)
            {
                CartFullCutInfo cartFullCutInfo = (CartFullCutInfo)cartItemInfo.Item;
                if (cartFullCutInfo.IsEnough)
                {
                    <h3><s class="bgMZ">满减</s> 已购满 @cartFullCutInfo.LimitMoney 元,优惠 @cartFullCutInfo.CutMoney 元</h3>
                }
                else
                {
                    <h3><s class="bgMZ">满减</s> 购满 @cartFullCutInfo.LimitMoney 元,优惠 @cartFullCutInfo.CutMoney 元</h3>
                }

                foreach (CartProductInfo cartProductInfo in cartFullCutInfo.FullCutCartProductList)
                {
                <div class="shoppingI">
                    <img src="@{@WorkContext.ImageCDN}/upload/store/@cartProductInfo.OrderProductInfo.StoreId/product/show/thumb60_60/@cartProductInfo.OrderProductInfo.ShowImg" width="64" height="64" />
                    <em><a href="@Url.Action("product", "catalog", new RouteValueDictionary { { "pid", cartProductInfo.OrderProductInfo.Pid } })">@cartProductInfo.OrderProductInfo.Name</a></em> <b>¥@cartProductInfo.OrderProductInfo.DiscountPrice<span>×@cartProductInfo.OrderProductInfo.RealCount</span><a href="javascript:void(0)" onclick="delCartProduct(@cartProductInfo.OrderProductInfo.Pid,1)">删除</a></b>
                    <div class="clear"></div>
                    @foreach (OrderProductInfo gift in cartProductInfo.GiftList)
                    {
                    <a href="@Url.Action("product", "catalog", new RouteValueDictionary { { "pid", gift.Pid } })" class="ZP1">[赠品]@gift.Name</a>
                    }
                </div>
                }
            }
        }
    }

</div>
<div class="shoppingJS">共<strong>@Model.TotalCount</strong>件商品 共计<b>￥@Model.OrderAmount</b></div>
<div style="text-align: right;background-color:#f5f5f5; padding-bottom:10px;"><a href="@Url.Action("confirmorder", "order")" class="goPay">去结算</a> <a href="javascript:void(0)" onclick="clearCart(1)" class="clearList">清空购物车</a></div>
<div id="csProudctCount" style=" display:none;">@Model.TotalCount</div>
}
else
{
 <div class="shoppingNone">购物车中还没有商品，赶紧选购吧！</div> 
 <div id="csProudctCount" style=" display:none;">0</div>
}
